using UnityEngine;

public abstract class BaseView<VMType> : MonoBehaviour where VMType : BaseViewModel
{
    protected BindContext<VMType> context;

    protected abstract void OnBind(BindContext<VMType> context);

    public abstract VMType GetViewModel();

    private void Awake()
    {
        context = BindManager.Instance.GetBindContext(GetViewModel());
        OnBind(context);
    }
}
